#!/bin/bash

#------------------------------------------------------------------------------
#Filename:	74720-sockfile.sh
#Version:	1.1
#Date:		2013/07/15
#Author:	yuanhui.shi
#Email:		yuanhui.shi@cs2c.com.cn
#Summary:	02.01系统核心功能-01文件系统-03文件分类-05验证系统可识别套接字类型文件
#Notes:		测试linux可以识别套接字类型文件
#Copyright:	China Standard Software Co.,Ltd.
#History:
#		Version 1.0,2013/07/15
#		-The first one
#		Version 1.1,2013/09/04
#		-Modify the script to satisfy the shell standard
#------------------------------------------------------------------------------


PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh
source ${SFROOT}/lib/NetOps.sh

function CleanData ()
{
 StopDaemon mysqld
 StopDaemon mariadb
 EchoInfo "74720-sockfile.sh执行完毕"
}
trap "CleanData" EXIT

CheckServiceExists mysqld

if [ $? -ne 0 ];then
    echo "mysqld.service or mysqld not exists"
    CheckServiceExists mariadb
    EchoResult "mariadb.service or mariadb exists"
    StartDaemon mariadb
else
    StartDaemon mysqld
fi

sleep 2
[ -S /var/lib/mysql/mysql.sock ]
EchoResult "系统可以识别套接字类型文件"

